﻿using NHibernate;
using OneStationFile.IDAL;
using OneStationFile.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OneStationFile.DAL
{
    public class TestDao : ITestDao
    {
        public bool Add1(Test test)
        {

            ISession session = FluentNHibernateHelper.GetSession();
            using (var trans = session.BeginTransaction())
            {
                //try
                //{ 
                session.SaveOrUpdate(test);
                session.Flush();
                trans.Commit();
                //return true;
                //}
                //catch (Exception)
                //{
                //trans.Rollback();
                return false;
                //}
            }

        }
    }
}
